/* v4 7.5.2018 */ //================================================= /** * This function is called when the user clicks on the anchor labeled "Aufklappen" * in the header of the particular year with all race results. * After having clicked the link, an AJAX call is executed to load the page with * the requested race results of the according year. To achieve this goal the * page must contain a certain structure: *
... ...
*
*
* The clicked link "Aufklappen" must be embedded in a
element that is emediatly * followed by an
element whoose id contains the link to the target html * page that contains all race results of the according year in several
* elements. After having loaded the target page, each */ function scanTargetResultPageAndBuildLinkList(anchorElement) { // slide down (open) the list with all races of the reagrded year $(anchorElement).parent("div").next("article").slideToggle("fast"); if ($(anchorElement).text() == "Aufklappen") { $(anchorElement).text("Zuklappen"); // select
immediatly after current
and do not display the // horizontal row since the list gets a border. var hrElement = "hr" + $(anchorElement).attr("href").substring(1); $('#' + hrElement).addClass("suppress"); // Check whether target page was already loaded and abort if neccessary if ($(anchorElement).parent("div").next("article").find("ul").length) { // target page already loaded, no need to makae AJAX call again! return; } // article id's value contains the target html page name var targetPage = $(anchorElement).parent("div").next("article").attr("id"); // list element where each results is added as
  • element var ulElement = $('